package com.wnxy.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Document(indexName = "goods")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Goods {
    @Id
    private String id;
    @Field(type = FieldType.Text,analyzer = "ik_smart")
    private String name;
    @Field(type = FieldType.Keyword)  // 类型为keyword不分词
    private String price;
    @Field(type = FieldType.Keyword)
    private String img;
}
